Feature/refactory install module#211
Feature/refactory install module#211ClausKlein wants to merge 22 commits intobemanproject:module-testfrom
Conversation
| #====================================================================== | ||
| # NOTE: Only for Release build with enabled install rules useful! CK | ||
| #====================================================================== | ||
| if(BEMAN_EXECUTION_INSTALL_CONFIG_FILE_PACKAGE AND NOT CMAKE_SKIP_INSTALL_RULES) | ||
| # test if the targets are usable from the install directory | ||
| add_test( | ||
| NAME install-to-stagedir | ||
| COMMAND | ||
| ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --prefix | ||
| ${CMAKE_BINARY_DIR}/stagedir --config $<CONFIG> | ||
| ) | ||
| add_test( | ||
| NAME find-package-test | ||
| COMMAND | ||
| ${CMAKE_CTEST_COMMAND} # --verbose | ||
| --output-on-failure -C $<CONFIG> # | ||
| --build-and-test "${CMAKE_SOURCE_DIR}/examples" | ||
| "${CMAKE_CURRENT_BINARY_DIR}/find-package-test" # | ||
| --build-generator ${CMAKE_GENERATOR} # | ||
| --build-makeprogram ${CMAKE_MAKE_PROGRAM} # | ||
| --build-options # | ||
| "-D BEMAN_USE_MODULES=${BEMAN_USE_MODULES}" | ||
| "-D CMAKE_BUILD_TYPE=$<CONFIG>" | ||
| "-D CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" | ||
| "-D CMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}" | ||
| "-D CMAKE_CXX_MODULE_STD=${CMAKE_CXX_MODULE_STD}" | ||
| "-D CMAKE_CXX_SCAN_FOR_MODULES=${CMAKE_CXX_SCAN_FOR_MODULES}" | ||
| "-D CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}" | ||
| "-D CMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}" | ||
| "-D CMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/stagedir" | ||
| ) | ||
| endif() |
There was a problem hiding this comment.
This add a test to build examples with the installed targets
| set(CMAKE_CXX_FLAGS_DEBUG_INIT "${SANITIZER_FLAGS}") | ||
|
|
||
| set(RELEASE_FLAGS "-O3 ${SANITIZER_FLAGS}") | ||
| set(RELEASE_FLAGS "-O3") |
There was a problem hiding this comment.
Do not add sanitizer flags for Release builds, it would be exported!
| "tests": ["Debug.Default", "Release.Default", "Release.MaxSan"] | ||
| "tests": [ | ||
| "Debug.Default", "Debug.MaxSan", | ||
| "Release.Default", "Release.Dynamic" |
There was a problem hiding this comment.
For Windows, static and dynamic must be build in Release and tested after install!
There was a problem hiding this comment.
@dietmarkuehl or may dynamic libraries now the problem?
rm old cmake modules (was only experimental code!)
cmake/prelude.cmake
Outdated
| if(NOT APPLE) | ||
| return() | ||
| endif() |
There was a problem hiding this comment.
@nickelpro @camio @JeffGarland Changed after review!
Now all non preset tests on UNIX CI workflows fails
There was a problem hiding this comment.
Do we know why these builds fail and is that something which can be fixed? I had a brief look but couldn’t actually spot a reason for the failure.
There was a problem hiding this comment.
Do we know why these builds fail and is that something which can be fixed? I had a brief look but couldn’t actually spot a reason for the failure.
line 37 above
| option( | ||
| BEMAN_USE_STD_MODULE | ||
| "Check if 'import std;' is possible with the toolchain?" | ||
| OFF | ||
| ON | ||
| ) |
There was a problem hiding this comment.
@dietmarkuehl this seems to cause the CI problems!
Only BEMAN_USE_MODULES AND BEMAN_USE_STD_MODULE should control it, even if the toolchain supports it!
Installing a Library
Installation is handled by the
beman_install_library()helper.Function Signature
Arguments
name
Logical package name (e.g. "beman.utility").
Used to derive config file names and cache variable prefixes.
TARGETS
Targets to install and export.
DEPENDENCIES (optional)
Semicolon-separated list, one dependency per entry.
Each entry is a valid
find_dependency()argument list.NOTE: you must use the bracket form for quoting if not only a package name is used!
"[===[beman.inplace_vector 1.0.0]===] [===[beman.scope 0.0.1 EXACT]===] fmt"NAMESPACE (optional)
Namespace for imported targets.
Defaults to "beman::".
EXPORT_NAME (optional)
Name of the generated CMake export set.
Defaults to "-targets".
DESTINATION (optional)
Installation directory for C++ module interface units.
Defaults to
${CMAKE_INSTALL_INCLUDEDIR}/beman/modules.This function installs the specified project TARGETS and its
FILE_SET TYPE HEADERSto the default CMAKE install destination.It also handles the installation of the CMake config package files if
needed. If the given targets has
FILE_SET TYPE CXX_MODULE, it will alsoinstalled to the given DESTINATION
BEMAN_INSTALL_CONFIG_FILE_PACKAGESList of package names for which config files should be installed.
<PREFIX>_INSTALL_CONFIG_FILE_PACKAGEPer-package override to enable/disable config file installation.
is the uppercased package name with dots replaced by underscores.
Caveats
Only one
FILE_SET of each TYPEis supported to install with this function yet!